]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
tests/perf: Use custom solid background in tests
authorJonas Ådahl <jadahl@gmail.com>
Fri, 2 Sep 2022 22:15:51 +0000 (00:15 +0200)
committerJonas Ådahl <jadahl@gmail.com>
Fri, 25 Nov 2022 21:09:54 +0000 (22:09 +0100)
They don't measure performance, and we don't want to have to install
gnome-backgrounds, so bundle a solid color background image to use
instead.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1349>

src/gnome-shell-perf-tool.in
tests/data/background.png [new file with mode: 0644]
tests/meson.build

index ae8a84d9fcca7fcfe0c556bfbe409785a1f2496d..79d1d6c23bb139421c9a06c6b325d921a0d21266 100755 (executable)
@@ -36,7 +36,8 @@ def start_shell(perf_output=None):
         env['SHELL_PERF_OUTPUT'] = perf_output
 
     # A fixed background image
-    env['SHELL_BACKGROUND_IMAGE'] = '@pkgdatadir@/perf-background.xml'
+    if os.getenv('SHELL_BACKGROUND_IMAGE') is None:
+      env['SHELL_BACKGROUND_IMAGE'] = '@pkgdatadir@/perf-background.xml'
 
     self_dir = os.path.dirname(os.path.abspath(sys.argv[0]))
     args = []
diff --git a/tests/data/background.png b/tests/data/background.png
new file mode 100644 (file)
index 0000000..cbe3f09
Binary files /dev/null and b/tests/data/background.png differ
index 8c020286132163b046ce56620e4da15e764486d5..739b74cd06d06bcd7af03b18908d78ca5d36bc4b 100644 (file)
@@ -46,11 +46,14 @@ perf_tests = [
 gvc_typelib_path = fs.parent(libgvc.get_variable('libgvc_gir')[1].full_path())
 libgvc_path = fs.parent(libgvc.get_variable('libgvc').full_path())
 
+background_file = files(join_paths('data', 'background.png'))
+
 perf_testenv = testenv
 perf_testenv.set('G_DEBUG', 'fatal-criticals')
 perf_testenv.set('G_MESSAGES_DEBUG', 'GNOME Shell')
 perf_testenv.set('GNOME_SHELL_DATADIR', data_builddir)
 perf_testenv.set('GNOME_SHELL_BUILDDIR', src_builddir)
+perf_testenv.set('SHELL_BACKGROUND_IMAGE', '@0@'.format(background_file))
 perf_testenv.append('GI_TYPELIB_PATH', gvc_typelib_path, separator: ':')
 perf_testenv.append('LD_LIBRARY_PATH', libgvc_path, separator: ':')